import React from 'react';
import dva from 'dva-react-router-3';
import {RouterContext} from 'dva-react-router-3/router';
import router from './router';
// import modeler from './modeler';

export default function createApp(opts, isServer) {
    const app = dva(opts);

    // modeler(app)
    if (isServer) {
        app.router(({history, renderProps}) => {
            return <RouterContext {...renderProps} />;
        });
    } else {
        app.router(router);
    }
    return app;
}
